#include "stdafx.h"

#include "v_socket_init.h"
#include <Winsock2.h>
#include <windows.h>

WinSockInitializor::WinSockInitializor() {
	WORD wVersionRequested;
	WSADATA wsaData;
	int err;
	wVersionRequested = MAKEWORD( 2, 2 );
	err = WSAStartup( wVersionRequested, &wsaData );
	if ( err != 0 ) {
		return;
	}
	if ( LOBYTE( wsaData.wVersion ) != 2 ||
			HIBYTE( wsaData.wVersion ) != 2 ) {
		WSACleanup( );
		return; 
	}
}
	
WinSockInitializor::~WinSockInitializor() {
	WSACleanup();
}

